// Camera.cpp
#include "Camera.h"
#include <windows.h>
#include <gl/GL.h>
#include <gl/GLU.h>

namespace ANvDbg
{
    Camera::Camera()
    {
        m_pos.x = 0.f;
        m_pos.y = 0.f;
        m_pos.z = 0.f;

        m_up.x = 0.f;
        m_up.y = 1.f;
        m_up.z = 0.f;

        m_view_point.x = 0.f;
        m_view_point.y = 0.f;
        m_view_point.z = -1.f;
    }

    void Camera::Update()
    {
        gluLookAt(m_pos.x, m_pos.y, m_pos.z, m_view_point.x, m_view_point.y, m_view_point.z, m_up.x, m_up.y, m_up.z);
    }

    void Camera::MoveStrafe(float delta)
    {
        m_pos.x += delta;
        m_view_point.x += delta;
    }

    void Camera::MoveForward(float delta)
    {
        m_pos.z -= delta;
        m_view_point.z -= delta;
    }

    void Camera::MoveBackward(float delta)
    {
        m_pos.z += delta;
        m_view_point.z += delta;
    }
}
